#ifndef SPI_H
#define SPI_H

#include "em_usart.h"
#include "em_gpio.h"
#include "em_cmu.h"
#include "em_device.h"
#include <stdio.h>

#define HFRCO_FREQUENCY         SystemCoreClockGet()
#define SPI_PERCLK_FREQUENCY    HFRCO_FREQUENCY
#define SPI_BAUDRATE            1000000

#define USART0_NUM               0
#define USART1_NUM               1
#define USART2_NUM               2

#define GPIO_POS0                0
#define GPIO_POS1                1
#define GPIO_POS2                2

void spi_init(uint8_t spi_num, uint8_t location, bool master);
uint8_t spi_read_write_byte(uint8_t address);

#endif 
